import {defineConfig,UserConfig} from 'vite'
import { viteElectronPlugin } from './vite-electron-plugin'
export default defineConfig(({mode})=>{

    const conf:UserConfig = {
        plugins:[
            viteElectronPlugin(),
        ],
        base: './'
    }

    if(mode=='vscode'){
        conf.build = {
            lib: {
                entry: 'src/main.ts',
                name: 'sg-script',
                fileName: 'sg-script',
                formats: ['umd'],
            },
            outDir: 'vs-ext/editor',
        }
    }

    return conf
})